const express = require('express');
const app = express();
const mysql = require('mysql');
const port = 8082;

var connection = mysql.createConnection({
    host: 'localhost',
    user: 'root',
    password: 'root',
    database: 'poor'
})
connection.connect();

app.get('/data', (req, res) => {
    connection.query('select*from strategy', function(err, rows, fields) {
        console.log(rows);
        res.send(rows)

    })
})

app.listen(port, () => {
    console.log('连接成功' + port);
})